<template>
  <div class="articleitem">
    <van-cell :title="obj.title"  :to="'/detail/'+obj.art_id" >
      <!-- 自定义右侧内容 -->
      <template v-if="obj.cover.type===1">
        <van-image
        class="right-box"
          :src="obj.cover.images[0]"
        />
      </template>
      <!-- 自定义标题下面内容 -->
      <template #label >
        <div class="left-box" v-if="obj.cover.type===3">
          <van-image
          v-for="(item,index) in obj.cover.images" :key="index"
          width="100"
          height="100"
          :src="item"
          />
        </div>
        <span>{{obj.aut_name}}</span><span class="comment_num">{{obj.comm_count}}</span><span>{{obj.pubdate |relativetime}}</span>
      </template>
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'articleitem',
  data () {
    return {

    }
  },
  props: {
    obj: {
      type: Object,
      required: true
    }
  },
  created () {

  },

  methods: {

  }
}
</script>

<style scoped lang='less'>
.articleitem{
  .comment_num{
    margin: 15px;
  }
  .left-box{
    display: flex;
    justify-content: space-between;
  }
  .right-box{
    width: 232px;
    height: 146px;
  }
}
</style>
